package com.humanminoritygame.model.mock;

import java.util.HashSet;
import java.util.Set;

import com.humanminoritygame.model.Question;
import com.humanminoritygame.model.QuestionRepo;


public class MockQuestionRepo implements QuestionRepo{
  private Set<Question> questions = new HashSet<Question>();
  
  public MockQuestionRepo(){
    Question q1 = new Question("Por donde vamos a mar del plata?", "Por Las Armas", "Por ruta 2");
    Question q2 = new Question("Heads or Tails", "Heads", "Tails");
    questions.add(q1);
    questions.add(q2);
  };


  @Override
  public void addQuestion(Question question) {
    questions.add(question);
  }

  @Override
  public Set<Question> getAllQuestions() {
    return questions;
  }

  @Override
  public Question getQuestionById(Long id) {
    for(Question question :  questions){
      if(question.getId()== id){
        return question;
      }
    }
    return null;
  }
}
